﻿using BaseUI;
using BLL;
using System;
using System.Data;

public partial class ManagementPlatform_SignatureManage_SignatureImage : BasePage
{
    private Sys_SignatureBLL ssb = new Sys_SignatureBLL();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["SIGNATUREID"]))
            {
                DataTable dt = ssb.GetSignatureDataById(decimal.Parse(Request.QueryString["SIGNATUREID"].ToString()));
                string path = "";
                if (dt.Rows[0]["SYSUSERID"].ToString() == lognUser.USER_ID.ToString())
                {
                    path = dt.Rows[0]["SIGNATUREPATH"].ToString();
                }

                if (!string.IsNullOrEmpty(path))
                {
                    // Response.OutputStream.Write();
                }

                // byte[] signatureByte = Signature.GetSignatureDataById(decimal.Parse(Request.QueryString["SIGNATUREID"].ToString().Trim()));//获取签章图片的二进制数据
                //if (signatureByte != null && signatureByte.Length != 0)
                //{
                //    Response.Clear();
                //    Response.Buffer = true;

                //    Response.ContentType = "image/jpeg";
                //    Response.AddHeader("Content-Disposition", "online;FileName=demo.jpeg");

                //    Response.BinaryWrite(signatureByte);
                //    Response.Flush();
                //    Response.End();
                //}
            }

            if (!string.IsNullOrEmpty(Request.QueryString["userID"]) && !string.IsNullOrEmpty(Request.QueryString["SIGNATURETYPE"]))
            {
                //byte[] signatureByte = Signature.GetSignatureDataByUserID(decimal.Parse(Request.QueryString["userID"].ToString().Trim()), decimal.Parse(Request.QueryString["SIGNATURETYPE"].ToString().Trim()));
                //if (signatureByte != null && signatureByte.Length != 0)
                //{
                //    Response.Clear();
                //    Response.Buffer = true;

                //    Response.ContentType = "image/jpeg";
                //    Response.AddHeader("Content-Disposition", "online;FileName=demo.jpeg");

                //    Response.BinaryWrite(signatureByte);
                //    Response.Flush();
                //    Response.End();
                //}
            }
        }
    }
}